﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace ES.Client.Expression.Field
{
    public class ParserFactory
    {
        public static IFieldParser Create(ExpressionType type)
        {
            IFieldParser parser = null;
            switch (type)
            {
                case ExpressionType.Convert:
                    parser = new ConvertParser();
                    break;
                case ExpressionType.MemberAccess:
                    parser = new MemberParser();
                    break;
                default:
                    parser = new DefaultParser();
                    break;
            }

            return parser;
        }
    }
}
